Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some refactoring in the base class #18

Merged
merged 9 commits into from
Oct 18, 2023
Merged

Conversation

mehdiataei
Copy link
Contributor

No description provided.

Copy link
Collaborator

@hsalehipour hsalehipour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see my comments.

src/base.py Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
examples/CFD/airfoil3d.py Show resolved Hide resolved
…ter errors, as well as fixed a bug in the distributed processing. Removed portpicker as a dependency as it can't be used for multi-process computations.
Copy link
Collaborator

@hsalehipour hsalehipour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see my comments.

@@ -109,7 +110,7 @@ def output_data(self, **kwargs):

if __name__ == '__main__':
precision = 'f32/f32'
lattice = LatticeD3Q27(precision)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be D3Q27 not D3Q19

src/base.py Outdated
if self.nz == 0 and not isinstance(value, LatticeD2Q9):
raise ValueError("For 2D simulations, lattice type must be LatticeD2Q9.")
if self.nz != 0 and isinstance(self, src.models.KBCSim) and not isinstance(value, LatticeD3Q27):
raise ValueError("For 3D KBC simulations, lattice type must be LatticeD3Q19,")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message is incorrect. The lattice myst be D3Q27. Also I would not include this check that relyes on model specific information (KBCSim here) inside the base class. You should raise an error inside models.py for KBCSim

src/base.py Outdated
def lattice(self, value):
if value is None:
raise ValueError("Lattice type must be provided.")
if self.nz == 0 and not isinstance(value, LatticeD2Q9):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not "assume" any default lattice for 2D scenarios. We can still assume D2Q9 for 2D flows and D3Q27 for 3D flows for ALL cases as the default setting when no lattice input is defined by the user.

@mehdiataei
Copy link
Contributor Author

All comments are addressed.

@mehdiataei mehdiataei merged commit 2180c56 into Autodesk:main Oct 18, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants